﻿@model FShare.Models.FileUploadModel

@{
    ViewBag.Title = "FShare - fastest file sharing";
}

<h2>Welcome to the FShare file sharing service</h2>

@using (Html.BeginForm("Upload", "Files", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <div id="upload-form-wrap">
        <fieldset>
            <div class="editor-label">
                <table class="upload-header-table">
                    <tr>
                        <td valign="top">
                            <div class="editor-label">
                                Choose files to upload:
                            </div>
                            <div class="editor-field">
                                <div id="file-upload-container">
                                    <input type="file" name="file0" />
                                </div>
                            </div>
                        </td>
                        <td class="add-more-files-area">
                            <a href="#" class="add-more-files editor-label" id="add-more">Add more files</a>
                            <script type="text/javascript">
                                var i = 1;
                                $("#add-more").click(function () {
                                    if (i < 15) {
                                        $("#file-upload-container").append('<input type="file" name="file' + i++ + '" />');
                                    }
                                });
                            </script>
                         </td>
                    </tr>
                </table>
            </div>
            
            <div class="editor-label">
                @Html.LabelFor(m => m.Description)
            </div>
            <div class="editor-field description-area ">
                @Html.TextAreaFor(m => m.Description)
            </div>

            <div class="editor-label">
                <span>Send links to:</span>
                <div class="email-input">
                    @Html.TextBoxFor(m => m.Email)
                    <input type="submit" name="Upload" value="Upload" id="upload-button" />
                    <div id="loading-area" style="display: inline">
                        <img src="@Url.Content("~/Content/al_loading.gif")" width="16" height="16" alt="loading-img" />
                        <span>Uploading, please wait...</span>

                        <script type="text/javascript">
                            $("#loading-area").hide();
                            $("#upload-button").click(function () {
                                $("#upload-button").hide();
                                $("#loading-area").show(750);
                            });
                        </script>
                    </div>
                </div>
            </div>
        </fieldset>
    </div>
}


